package com.sc.nft.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.CdkActivityInfo;
import com.sc.nft.entity.UserInfo;
import com.sc.nft.entity.vo.AddCdkActivityVO;
import com.sc.nft.entity.vo.CdkExchangeRecordVO;
import com.sc.nft.entity.vo.CdkGasCostVO;
import com.sc.nft.entity.vo.PageCdkVO;
import com.sc.nft.entity.vo.ProductCdkRecordVO;
import com.sc.nft.enums.GasConsumeTypeEnum;
import com.sc.nft.enums.ProductCdkTypeEnum;
import com.sc.nft.enums.RedemptionCodeRuleEnum;
import com.sc.nft.exception.GlobalException;

import java.math.BigDecimal;


public interface CDKProductService {
    /**
     * 兑换CDK
     * @param cdk
     */
    void exchangeCdk(String cdk, UserInfo user) throws GlobalException;
    
    /**
     * 获取cdk兑换上链费
     * @param cdk
     * @param userId
     * @return
     */
    CdkGasCostVO getGasCost(String cdk,Long userId);


    /**
     * 分页查询记录
     * @param pageNo
     * @param pageSize
     * @return
     */
    Page<ProductCdkRecordVO> getExchangeList(Integer pageNo, Integer pageSize);

    /**
     * 分页查询活动
     * @param pageNo
     * @param pageSize
     * @return
     */
    Page<AddCdkActivityVO> getCdkActivityList(Integer pageNo, Integer pageSize,String name);

    /**
     * 分页条件查询CDK
     * @param cdkActivityId
     * @param cdk
     * @param isUse
     * @param isExpired
     * @param pageNo
     * @param pageSize
     * @return
     */
    Page<PageCdkVO> getPageCdk(Long cdkActivityId, String cdk, Integer isUse, Integer isExpired, Integer pageNo, Integer pageSize);

    /**
     * 修改CDK活动
     * @param id
     * @param activityTitle
     * @param activityDescription
     * @param beginTime
     * @param endTime
     */
    void updateCdkActivity(Long id,
                           String activityTitle,
                           String activityDescription,
                           String beginTime,
                           String endTime,
                           ProductCdkTypeEnum productType,
                           String firstTitle,
                           Long productId,
                           Boolean gasConf,
            GasConsumeTypeEnum consumeType,
            BigDecimal consumeCost,
                           Long daoId, RedemptionCodeRuleEnum type, Integer redemptionTotal,Integer userUseLimit);


    /**
     * 生成CDK
     * @param activityId
     * @param generateNum
     */
    void generateCDK(Long activityId, Integer generateNum);

    /**
     * 查询CDK兑换记录
     * @param userTel
     * @param cdk
     * @param pageNo
     * @param pageSize
     * @return
     */
    Page<CdkExchangeRecordVO> adminCdkExchangeRecord(String userTel, String cdk, Integer pageNo, Integer pageSize,Long cdkActivityId);

    /**
     * 删除CDK活动
     * @param id
     */
    void deleteCdkActivity(Long id);

    /**
     * 自定义生成CDK
     * @param cdkActivityInfo
     * @param id
     * @param redemptionTotal
     */
    void createCustomCDK(CdkActivityInfo cdkActivityInfo, Long id, Integer redemptionTotal);
}

